﻿Imports System.Windows

Public Class DynamicAttachableProperty
    Inherits DependencyObject



    Public Shared Function GetDynamicValue(ByVal element As DependencyObject) As Object
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        Return element.GetValue(DynamicValueProperty)
    End Function

    Public Shared Sub SetDynamicValue(ByVal element As DependencyObject, ByVal value As Object)
        If element Is Nothing Then
            Throw New ArgumentNullException("element")
        End If

        element.SetValue(DynamicValueProperty, value)
    End Sub

    Public Shared ReadOnly DynamicValueProperty As  _
                           DependencyProperty = DependencyProperty.RegisterAttached("DynamicValue", _
                           GetType(Object), GetType(DynamicAttachableProperty), _
                           New FrameworkPropertyMetadata(AddressOf DynamicValueChanged))

    Shared Sub DynamicValueChanged(ByVal d As DependencyObject, ByVal e As DependencyPropertyChangedEventArgs)
        'Throw New NotImplementedException
    End Sub




End Class
